package com.itheima.test6;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>(List.of("王佳乐","张三丰", "王思聪", "张飞"));
        List<Person> newList=new ArrayList<>();
        list.stream().forEach(s -> {
            Person stu = new Person(s);
            newList.add(stu);
        });
        for (Person person : newList) {
            System.out.println(person);
        }
    }
}
